﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace StableDiffusionTools.AUTOMATIC1111
{
    public class Options
    {
        //[JsonPropertyName("interrogate_keep_models_in_memory")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public bool? interrogate_keep_models_in_memory { get; set; } = null;
        //[JsonPropertyName("interrogate_clip_num_beams")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public double? interrogate_clip_num_beams { get; set; } = null;
        //[JsonPropertyName("interrogate_clip_min_length")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public double? interrogate_clip_min_length { get; set; } = null;
        //[JsonPropertyName("interrogate_clip_max_length")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public double? interrogate_clip_max_length { get; set; } = null;
        //[JsonPropertyName("interrogate_deepbooru_score_threshold")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public double? interrogate_deepbooru_score_threshold { get; set; } = null;
        //[JsonPropertyName("deepbooru_sort_alpha")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public bool? deepbooru_sort_alpha { get; set; } = null;
        //[JsonPropertyName("deepbooru_use_spaces")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public bool? deepbooru_use_spaces { get; set; } = null;
        //[JsonPropertyName("deepbooru_escape")]
        [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
        public bool? deepbooru_escape { get; set; } = null;

        public static Options FromInterrogateOptions(bool interrogate_keep_models_in_memory, int interrogate_clip_num_beams, int interrogate_clip_min_length, int interrogate_clip_max_length, double interrogate_deepbooru_score_threshold, bool deepbooru_sort_alpha, bool deepbooru_use_spaces, bool deepbooru_escape)
        {
            return new Options()
            {
                interrogate_keep_models_in_memory = interrogate_keep_models_in_memory,
                interrogate_clip_num_beams = interrogate_clip_num_beams,
                interrogate_clip_min_length = interrogate_clip_min_length,
                interrogate_clip_max_length = interrogate_clip_max_length,
                interrogate_deepbooru_score_threshold = interrogate_deepbooru_score_threshold,
                deepbooru_sort_alpha = deepbooru_sort_alpha,
                deepbooru_use_spaces = deepbooru_use_spaces,
                deepbooru_escape = deepbooru_escape
            };
        }
    }

}
